import React, { useState } from "react";
import { Badge, Button, Space } from "antd";
import { useRequest } from "ahooks";
import { getRequestCgi } from "@/request";
const badge = () => {
    useRequest(() => {
        return getRequestCgi('/api/list')
    },{
        manual: false,
        onSuccess: (res) => {
            console.log(res);
        }
    })
    const [count,setCount] = useState(1)

    return <Space direction="vertical">
        <Badge status="success" text={'success'} />
        <Badge status="error" text={'error'} />
        <Badge status="default" text={'default'} />
        <Badge status="processing" text={'processing'} />
        <Badge status="warning" text={'warning'} />
        <Badge count={count} offset={[0, 0]}>
            <Button onClick={() => setCount(count + 1)}>{'保存'}</Button>
        </Badge>
    </Space>
}

export default badge